import { PORT7, PORT8 } from '@/api/config/servicePort';
import http from '@/api';

/**
 * @name 登录模块
 */
// 用户登录
export const loginApi = params => {
  return http.post(PORT8 + `/login`, params, { loading: false });
};

// 测试接口目前用于检测token是否过期
export const verifyToken = () => http.post(PORT8 + `/test/checkToken`);

// 查询版本
export const versionSearch = () => http.get(PORT8 + `/version/search/NMES-PC`);

// 获取用户权限
export const userFindPermission = (params: { username: string }) => {
  return http.get(PORT7 + `/findPermission`, params, { loading: false });
};

// 用户退出登录
export const logoutApi = () => {
  return http.post(PORT8 + `/logout`);
};
